#!/usr/bin/env python

import cv2
from billboard import *
import numpy as np
from utils import mouse_handler
from utils import get_four_points
import sys


if __name__ == '__main__' :
    im_src = loadImage('car.png');
    im_dst = loadImage('3.jpeg')

    bb = Billboard(im_dst)

    print('Click on four corners of a billboard and then press ENTER')
    pts_dst = get_four_points(im_dst)
    print pts_dst

    bb.attachImageWithBlur(pts_dst, im_src, gaussianRange=(55, 55))
    im_dst = bb.getImage()
    showImage(im_dst, "final")
    im_dst = bb.getCompressImage(4)
    showImage(im_dst, "compress")

    cv2.waitKey(0)
    saveImage("./compress.jpeg", im_dst)
